home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc Source Code / Utilities / Interfaces / UseRsrcM.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-22  |  1.6 KB  |  78 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        UseRsrcM.h
  3.  
  4.     Contains:    Functions for using resources from the resource fork of a library
  5.  
  6.     Owned by:    Jens Alfke
  7.  
  8.     Copyright:    © 1994 - 1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Theory of Operation:
  11.     
  12.     This utility provides convenient access to a part editor's (or other shared
  13.     library's) resources -- a library's resource fork is _not_ by default open
  14.     or accessible. Please see the OpenDoc tech note "Using Resources" for full
  15.     instructions.
  16.     
  17.     In Progress:
  18.         
  19. */
  20.  
  21.  
  22. #ifndef _USERSRCM_
  23. #define _USERSRCM_
  24.  
  25. #ifndef _ODTYPES_
  26. #include "ODTypes.h"
  27. #endif
  28.  
  29. #ifndef _EXCEPT_
  30. #include "Except.h"
  31. #endif
  32.  
  33. #ifndef __CODEFRAGMENTS__
  34. #include <CodeFragments.h>
  35. #endif
  36.  
  37.  
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41.  
  42.  
  43. OSErr InitLibraryResources( CFragInitBlockPtr );
  44.  
  45. void  CloseLibraryResources( );
  46.  
  47.  
  48. ODSLong    BeginUsingLibraryResources( );
  49. void    EndUsingLibraryResources( ODSLong );
  50.  
  51.  
  52. ODHandle    ODReadResource( ResType type, short id );
  53. ODHandle    ODReadNamedResource( ResType type, ConstStr255Param name );
  54.  
  55. ODPtr        ODReadResourceToPtr( ResType type, short id );
  56. ODPtr        ODReadNamedResourceToPtr( ResType type, ConstStr255Param name );
  57.  
  58. void        ODGetString( Str255 str, short id );
  59. void        ODGetIndString( Str255 str, short id, short index );
  60.  
  61.  
  62. #ifdef __cplusplus
  63.     } // ends extern "C"
  64.     
  65.     class CUsingLibraryResources :private Destructo {
  66.         public:
  67.             CUsingLibraryResources( )    {fRefNum=BeginUsingLibraryResources();}
  68.            ~CUsingLibraryResources( );
  69.         private:
  70.             ODSLong fRefNum;
  71.     };
  72.     
  73.     inline void BeginUsingLibraryResources( ODSLong &ref )    // param is for backward compatibility
  74.             {ref=BeginUsingLibraryResources();}
  75. #endif
  76.  
  77.  
  78. #endif /* _USERSRCM_ */